<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="jingxuan/libs/angular.js" type="text/javascript" charset="utf-8"></script>
		<script src="jingxuan/libs/angular-ui-router.js" type="text/javascript" charset="utf-8"></script>
		<!--bootstrap插件-->
		<script src="jingxuan/libs/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="jingxuan/libs/bootstrap.min.css"/>
		<script src="jingxuan/libs/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
			
		<!--js引入样式-->
		<script src="jingxuan/js/dhnr.js" type="text/javascript" charset="utf-8"></script>
		<script src="jingxuan/js/ztnr.js" type="text/javascript" charset="utf-8"></script>
		<script src="search/js/search.js" type="text/javascript" charset="utf-8"></script>
		<script src="free/js/xiangguan.js" type="text/javascript" charset="utf-8"></script>
		<script src="free/js/interfix.js" type="text/javascript" charset="utf-8"></script>
		<script src="free/js/free.js" type="text/javascript" charset="utf-8"></script>
		<script src="jingxuan/js/search.js" type="text/javascript" charset="utf-8"></script>	
		<!--css样式-->
		<link rel="stylesheet" type="text/css" href="jingxuan/css/jx.css"/>
		<link rel="stylesheet" type="text/css" href="jingxuan/css/dhnr.css"/>
		<link rel="stylesheet" type="text/css" href="jingxuan/css/ztnr.css"/>
		<link rel="stylesheet" type="text/css" href="free/css/free.css" />
		<link rel="stylesheet" type="text/css" href="search/css/search.css">
		<link rel="stylesheet" type="text/css" href="free/css/interfix.css">
		<link rel="stylesheet" type="text/css" href="free/css/xiangguan.css">
		<link rel="stylesheet" type="text/css" href="jingxuan/css/search.css"/>
	</head>
	<body ng-app="myApp" ng-controller="Myctrl">
		<div ui-view></div>
		<!--底部样式-->

			 <div class="footer" ng-show="isshow">
				<ul>
					<li><a ui-sref="/">书架</a></li>
					<li><a ui-sref="/jx">精选</a></li>
					<li><a ui-sref="/mf">免费</a></li>
					<li><a ui-sref="/fl">分类</a></li>
				</ul>
			</div> 
	</body>
	<script type="text/javascript">
		var app=angular.module("myApp",['ui.router','dh','zt','searchapp','interfixapp','xiangguanapp']);
		app.config(['$stateProvider','$urlRouterProvider',function($stateProvider,$urlRouterProvider){
			$urlRouterProvider.otherwise('/jx');
			$stateProvider.state('/',{
				url:"/",
				templateUrl:"shujia.html"
			})			
			.state('/jx',{
				url:"/jx",
				templateUrl:"jingxuan/jingxfirst.html"
			})
			.state('/mf',{
				url:"/mf",
				templateUrl:"free.html"
			})
			.state('/fl',{
				url:"/fl",
				templateUrl:"fenlei.html"
			})
			//两个二级路由
			.state('/dhnr',{
				url:"/dhnr",
				templateUrl:"jingxuan/dhnr.html",
				controller:"Dhctrl"
			})
			.state('/ztnr',{
				url:"/ztnr",
				templateUrl:"jingxuan/ztnr.html",
				controller:"Ztctrl"
			})
			.state('/dhph',{
				url:"/dhph",
				templateUrl:"jingxuan/dhph.html",
				controller:"Phctrl"
			})
			.state('/search',{
				url:"/search",
				templateUrl:"search/search.html",
				controller:"SearchCtrl"
			})
			.state('/interfix',{
				url:"/interfix",
				templateUrl:"free/interfix.html",
				controller:"interfixCtrl"
			})
			.state('/xiangguan',{
				url:"/xiangguan",
				templateUrl:"free/xiangguan.html",
				controller:"xiangguanCtrl"
			})
		}])
		//精选首页
		app.controller("Myctrl",function($scope,$http,$rootScope){
			$rootScope.isshow=true;
			//获取导航数据
			$http.get("jingxuan/json/jxzjdh.json").then(function(data){
//				console.log(data.data)
				$scope.ban=data.data
			})
			//获取主体内容数据
			$http.get("jingxuan/json/data-1.json").then(function(data){
//				console.log(data.data.all_book_items)
				$scope.man=data.data.all_book_items
			})
			$http.get("jingxuan/json/jxzjzt.json").then(function(data){
//				console.log(data.data.all_book_items)
				$scope.zbctr=data.data
			})

		})
	</script>
</html>
